; Music of Herobotix (1986) (Wise OWL Software Ltd.) (Dave Rogers) 
; Ripped by Megachur the 17/11/2006

	write "HEROBOTI.BIN"

music_date_rip	equ &11b6
music_adr	equ &b5c5
first_theme	equ 0
last_theme	equ 0

	read "music_header_v1_0.asm"

;HEROBOSD.ASM        HEROBOTIX sound driver       J.Dave Rogers, 1988


;******************************************************
SPECVERSION  EQU   0               ;0=AMSTRAD 1=SPEC

SOUNDCOD     EQU   music_begin		;32768           ;MACHINE CODE

;SOUNDATA     EQU   SOUNDCOD + 953  ;DATABLOCK ADDRESS
;******************************************************
           
             NOLIST

ENVSINDEX    EQU       SOUNDATA+200
TUNESINDEX   EQU       ENVSINDEX+72

ENVCOUNTS    EQU 0
ENTCOUNTS    EQU 2
ENVPTR       EQU 4
ENTPTR       EQU 6
ENV0         EQU 8
ENT0         EQU 10
ENVADR       EQU 12
ENTADR       EQU 14

CHANACTIVE   EQU 16
MAINCOUNT    EQU 17
DATAPTR      EQU 18
CONPTR       EQU 20
PTRREFR      EQU 22
PITCHSHIFT   EQU 24
NOISEDIS     EQU 25
CH_ENABLE    EQU 26
INTERVAL     EQU 27
CURRENTNOTE  EQU 28
CHORDTOGGLE  EQU 29
CURRENTDUR   EQU 30

;             ORG  SOUNDCOD
;             WRITE "HEROBOSD.BIN"
START        DEFL $

;---------------------------------------
JUMPBLOCK:      JP PLAY
                JP SILENCE
 ;               JP TUNE48K
SPEC48FLAG      DB 0
BASICSTART:
;
.init_music
;
		LD E,&22		; 1   modified by Megachur
                LD C,1
;----------------------
DOSOUND:        CALL FINDBLOC    ;E=BLOC   C=CHAN   B=PRIORITY  HL=BLOCADR
                LD A,(HL)
                CP 9
                JR NC,NOCHANMARKER
                LD C,A
                INC HL
                LD A,(HL)
NOCHANMARKER:   CP 244
                LD B,10
                JR NZ,NOPRIMARKER
                INC HL
                LD B,(HL)
                INC HL
NOPRIMARKER     DEC C     ;FINDCHAN
                JR Z,TRY1
                DEC C
                JR Z,TRY2
                DEC C
                JR Z,TRY3

CHANALT:        LD A,(STORE2+CHANACTIVE)   ;chan 2 if poss (chorus!)
                OR A
                JR Z,TRY2                  ;ELSE 1:

TRY1:           LD DE,STORE1+CHANACTIVE
                LD A,(DE)
                LD C,A
                LD A,B
                SUB C
                RET C                   ;priority too low
                XOR A
                LD (DE),A               ;chan off while reset
                LD (STORE1+INTERVAL),A
                LD (STORE1+PITCHSHIFT),A
                INC A
                LD (STORE1+MAINCOUNT),A
                LD (STORE1+DATAPTR),HL
                LD (STORE1+CONPTR),HL
                LD (STORE1+PTRREFR),HL
                LD A,B
                LD (DE),A
                RET

TRY2:           LD DE,STORE2+CHANACTIVE
                LD A,(DE)
                LD C,A
                LD A,B
                SUB C
                RET C
                XOR A
                LD (DE),A
                LD (STORE2+INTERVAL),A
                LD (STORE2+PITCHSHIFT),A
                INC A
                LD (STORE2+MAINCOUNT),A
                LD (STORE2+DATAPTR),HL
                LD (STORE2+CONPTR),HL
                LD (STORE2+PTRREFR),HL
                LD A,B
                LD (DE),A
                RET

TRY3:           LD DE,STORE3+CHANACTIVE
                LD A,(DE)
                LD C,A
                LD A,B
                SUB C
                RET C
                XOR A
                LD (DE),A
                LD (STORE3+INTERVAL),A
                LD (STORE3+PITCHSHIFT),A
                INC A
                LD (STORE3+MAINCOUNT),A
                LD (STORE3+DATAPTR),HL
                LD (STORE3+CONPTR),HL
                LD (STORE3+PTRREFR),HL
                LD A,B
                LD (DE),A
                RET

;------
;
.stop_music
;
SILENCE:        XOR A
                LD (STORE1+CHANACTIVE),A
                LD (STORE2+CHANACTIVE),A
                LD (STORE3+CHANACTIVE),A
                LD (NSEFLAG),A
                LD (STORE1+INTERVAL),A
                LD (STORE2+INTERVAL),A
                LD (STORE3+INTERVAL),A
                LD (STORE1+PITCHSHIFT),A
                LD (STORE2+PITCHSHIFT),A
                LD (STORE3+PITCHSHIFT),A
                LD (BUFF+8),A
                LD (BUFF+9),A
                LD (BUFF+10),A
                LD A,1+2+4+8+16+32
                LD (BUFF+7),A

;***********
IF SPECVERSION

ALL13REGS:      LD HL,BUFF+13
                LD E,13
                XOR A
                JP NEXTREG
ELSE

ALL13REGS:      LD HL,BUFF+13
                LD DE,#F40D           ;13
                XOR A
                JP NEXTREG
ENDIF
;***********

FINDBLOC:       LD   A,E
                ADD  A,A
                ADD  A,TUNESINDEX AND #00FF
                LD   L,A
                ADC  A,TUNESINDEX AND #FF00 /256
                SUB  L
                LD   H,A
                LD   E,(HL)
                INC  HL
                LD   D,(HL)
                LD HL,SOUNDATA
                ADD HL,DE
                RET

FINDENV:        LD   A,E                ;must not corrupt hl
                ADD  A,A
                ADD  A,ENVSINDEX AND #00FF
                LD   E,A
                ADC  A,ENVSINDEX AND #FF00 / 256
                SUB  E
                LD   D,A

                LD  A,(DE)
                ADD A,SOUNDATA AND #00FF
                LD  C,A

                INC  DE
                LD  A,(DE)
                ADC A,SOUNDATA AND #FF00 / 256
                LD B,A
                RET

;--------------------------------------EVERY 1/50 S-------------
;
.play_music
;
PLAY:           LD A,(STORE1+CHANACTIVE)
                OR A
                JR Z,C2
                LD  IX,STORE1
                LD IY,BUFF+8
                LD HL,(BUFF)
                LD (PITCHTEMP),HL
                LD HL,(STORE1+DATAPTR)
                CALL TESTCHAN
                LD (BUFF),HL

C2:             LD A,(STORE2+CHANACTIVE)
                OR A
                JR Z,C3
                LD  IX,STORE2
                LD IY,BUFF+9
                LD HL,(BUFF+2)
                LD (PITCHTEMP),HL
                LD HL,(STORE2+DATAPTR)
                CALL TESTCHAN
                LD (BUFF+2),HL

C3:             LD A,(STORE3+CHANACTIVE)
                OR A
                JR Z,CHORUS

                LD IX,STORE3
                LD IY,BUFF+10
                LD HL,(BUFF+4)
                LD (PITCHTEMP),HL
                LD HL,(STORE3+DATAPTR)
                CALL TESTCHAN
                JP NOCHORUS

CHORUS:         OR H              ;A ALWAYS 0 HERE
                OR L
                JR Z,NOCHORUS     ;PAUSES
                DEC HL
                DEC HL
                LD A,(BUFF+9)     ;CH3 VOL= CH2 VOL
                LD (BUFF+10),A
                LD A,(BUFF+7)     ;NO NOISE (C3 NOISEGATE COULD STILL BE OPEN)
                OR 32
                LD (BUFF+7),A

NOCHORUS:       LD (BUFF+4),HL

                CALL DOENSE

;***************
IF SPECVERSION

ALLREGIST:      XOR A
                LD HL,BUFF+10
                LD E,10
NEXTREG:        LD BC,65533
                OUT (C),E
                LD BC,49149
                LD A,(HL)      
                DEC HL
                OUT (C),A
                DEC E
                JP P,NEXTREG
                RET

ELSE

ALLREGIST:      XOR  A
                LD   HL,BUFF+10  ;10
                LD   DE,#F40A    ;10
NEXTREG:        LD   B,D
                OUT  (C),E
                LD   BC,63168    ;(#F6*256+%11000000)
                OUT  (C),C
                OUT  (C),A
                LD   B,D
                LD   C,(HL)
                DEC  HL
                OUT  (C),C
                LD   BC,63104    ;(#F6*256+%10000000)
                OUT  (C),C
                OUT  (C),A
                DEC  E
                JP   P,NEXTREG
                RET

ENDIF
;*************

;FOR EACH OF THE 3 CHANNELS:

TESTCHAN:       DEC  (IX+MAINCOUNT)
                JP NZ,DOENV_ENT

                LD A,20
                LD (DECI+1),A        ;INIT.STOPHANG

DECI            LD A,20
                DEC A
                LD (DECI+1),A
                RET Z

                LD   A,(HL)
                INC  HL
                LD   E,(HL)
                INC HL

SUBSELECT    OR A
 
             JP   Z,DOPAUSE
             CP   9
             JR   C,STARTLOOP
             CP   101
             JP   C,NEWNOTE
             CP 228
             JP C,COMPNOTE
             CP 255
             JP Z,RETCONBLOC
             CP 244
             JR Z,NEWPRIORITY

             SUB 230
             JP  Z,NOISE
             DEC A
             DEC A
             JR  Z,QUICKOUT
             DEC A
             JR  Z,NEWENV
             DEC A
             JR  Z,NEWENT
             DEC A
             JR  Z,NEWENSE
             DEC A
             JP  Z,SETINTERVAL
             DEC A
             JR  Z,NEWKEY
             DEC A
             JR  Z,GONEWBLOC

             ;any other val=FOLLOW THROUGH=SAFETY NET

KILLCHAN:       LD (IX+CHANACTIVE),0
                LD (IY+0),0             ;CH VOL
                RET

NEWPRIORITY:    LD (IX+CHANACTIVE),E
                JP DECI

QUICKOUT:       LD (IX+MAINCOUNT),1     ;TIME SHARER
                DEC HL
                LD (IX+DATAPTR),L
                LD (IX+DATAPTR+1),H
                LD HL,0
                RET

STARTLOOP:      PUSH HL
                LD C,A     ;C=CHAN
                CALL DOSOUND
                POP HL    
                JP DECI

NOISE:          INC A          ;A ALWAYS 0 HERE
                LD (NSEFLAG),A
                LD   A,E
                LD   (BUFF+6),A
                JP   DECI

NEWKEY:         LD   (IX+PITCHSHIFT),E
                JP   DECI

NEWENT:         CALL FINDENV
                LD (IX+ENTADR),C
                LD (IX+ENTADR+1),B
                JP DECI

NEWENV:         CALL FINDENV
                LD (IX+ENVADR),C
                LD (IX+ENVADR+1),B
                JP DECI

NEWENSE:        CALL FINDENV
                LD (ENSSTORE+12),BC
                JP DECI

GONEWBLOC:      LD   (IX+CONPTR+1),H
                LD   (IX+CONPTR),L
                CALL FINDBLOC
                JP   DECI

RETCONBLOC      LD   H,(IX+CONPTR+1)
                LD   L,(IX+CONPTR)
                LD A,(HL)
                INC A     ;TEST 255
                JP NZ,DECI
                LD H,(IX+PTRREFR+1)
                LD L,(IX+PTRREFR)
                JP DECI

SETINTERVAL     LD (IX+INTERVAL),E
                JP DECI
;-----------------------------------------DO NOTEs--------
COMPNOTE:       AND 127
                DEC HL
                LD E,(IX+CURRENTDUR)

NEWNOTE:        ADD  A,(IX+PITCHSHIFT)

;*******
IF SPECVERSION
                SUB 12       ;HALVE FREQY IF SPECTRUM (AY CLOCKED AT 2 MHZ)
ENDIF
;*******

DOPAUSE:        LD   (IX+MAINCOUNT),E
                LD   (IX+CURRENTDUR),E
                LD   (IX+CURRENTNOTE),A
                LD   (IX+DATAPTR+1),H
                LD   (IX+DATAPTR),L

PITCHTAB        EQU  SOUNDATA

                ADD  A,A
                ADD  A,PITCHTAB AND #00FF
                LD   L,A
                ADC  A,PITCHTAB AND #FF00 /256
                SUB  L
                LD   H,A
                LD   DE,PITCHTEMP
                LDI
                LDI

                LD (IY+0),0

                PUSH IX           ;RESTART ENV/ent
                POP  DE
                LD   HL,8
                ADD  HL,DE
                LDI
                LDI
                LDI
                LDI
                LDI
                LDI
                LDI
                LDI

                XOR A
                LD HL,NSEFLAG
                OR  (HL)
                LD (HL),0
                LD   L,(IX+NOISEDIS)
                JR   Z,GATING

NOISEON:        LD  HL,(ENSSTORE+ENVADR)
                LD  (ENSSTORE+ENVPTR),HL
                LD  HL,00
                LD  (ENSSTORE),HL

GATING:         LD   A,(BUFF+7)
                AND  (IX+CH_ENABLE)
                OR   L
                AND  32+16+8+4+2+1
                LD   (BUFF+7),A
;---------------------------------------------------

DOENV_ENT:      CALL ENGEN

                LD A,(IY+0)
                ADD A,C
                SUB  128
                LD   (IY+0),A

;-------------------
                LD HL,(PITCHTEMP)     ;PAUSE ?
                LD A,H
                OR L
                RET Z
                LD A,(IX+INTERVAL)    ;CHORD ?
                OR A
                JR NZ,DOCHORD
DOENT:          INC IX
                INC IX
                CALL ENGEN
                LD HL,(PITCHTEMP)
                LD B,0
IF SPECVERSION
                ADD  HL,BC
                ADD HL,BC
                LD   C,128
                SBC HL,BC
                SBC  HL,BC
ELSE
                ADD HL,BC
                LD C,128
                SBC HL,BC
ENDIF
                RET
;--------------------------------------
DOCHORD:        DEC (IX+CHORDTOGGLE)
                LD A,(IX+CURRENTNOTE)
                JR Z,FINDSETPITCH
                ADD (IX+INTERVAL)
                LD (IX+CHORDTOGGLE),1

;PITCHTAB        EQU  SOUNDATA
FINDSETPITCH:   ADD  A,A
                ADD  A,PITCHTAB AND #00FF
                LD   L,A
                ADC  A,PITCHTAB AND #FF00 /256
                SUB  L
                LD   H,A

                LD   E,(HL)
                INC HL
                LD  D,(HL)
                EX HL,DE
                RET
;-------------------
DOENSE:         LD IX,ENSSTORE
                CALL ENGEN

                LD HL, BUFF+6
                LD   A,(HL)
                ADD  A,C
                SUB  128
                LD   (HL),A
                CP 17
                RET C
NOISEOFF:       INC HL          ;HL=BUFF+7
                LD A,(HL)
                OR 32+16+8
                LD (HL),A
                RET
;--------------------------------------
ENGEN           PUSH IX
                POP  HL
                LD   D,(IX+ENVPTR+1)
                LD   E,(IX+ENVPTR)
                INC  (HL)
                LD   A,(DE)
                SUB  (HL)

                LD C,128        ;=0!
                RET  NZ
                LD   (HL),A
                INC DE
                LD  A,(DE)

                LD C,A

                INC  DE
                INC  HL
                INC  (HL)
                LD   A,(DE)
                SUB  (HL)
                RET  NZ
                LD   (HL),A
                INC  DE
                LD   A,(DE)
                INC  A
                JR   NZ,NEXTSECT
                LD   D,(IX+ENVADR+1)
                LD   E,(IX+ENVADR)
NEXTSECT:       LD   (IX+ENVPTR+1),D
                LD   (IX+ENVPTR),E
                RET

;---------------------

BUFF:     DW  00
          DW  00
          DW  00
          DB  0
          DB  32+16+8
          DB  0
          DB  0
          DB  0
          DB  8,0
          DB  10

PITCHTEMP:  DW 00

NSEFLAG:    DB 0

ENSSTORE: DW 00
          DW 10
          DW 00
          DW 04
          DW 00
          DW 18
          DW 00

;-----CHANNEL STORES

STORE1:   DW  00
          DW  00
          DW  00
          DW  00

          DW  00
          DW  00
          DW  00
          DW  00

          DB  0
          DB  0
          DW  00
          DW  00
          DW  00
          DB  0
          DB   8          ;NOISE DIS
          DB  32+16+4+2-4 ;CHAN ENABLE  (-4 'COS CHORUS=CH3 ALWAYS ON)
          DB  0
          DB  0
          DB  0
          DB  0

STORE2: DW  00
        DW  00
        DW  00
        DW  00

        DW  00
        DW  00
        DW  00
        DW  00

        DB  0
        DB  0
        DW  00
        DW 00
        DW  00
        DB  0
        DB  16
        DB  32+8+4+1-4
        DB  0
        DB  0
        DB  0
        DB  0

STORE3: DW  00
        DW  00
        DW  00
        DW  00

        DW  00
        DW  00
        DW  00
        DW  00

        DB  0
        DB  0
        DW  00
        DW 00
        DW  00
        DB  0
        DB  32
        DB  16+8+2+1
        DB  0
        DB  0
        DB  0
        DB  0
;---------------------48K SOUND----------------

TUNE48K:

SPARE           DB 42
;-----------------------
SOUNDATA
	db #00,#00
	dw #0eae,#0ddb,#0d14,#0c58
	dw #0ba7,#0aff,#0a61,#09cc
	dw #093f,#08bb,#083d,#07c7
	dw #0757,#06ee,#068a,#062c
	dw #05d3,#0580,#0531,#04e6
	dw #04a0,#045d,#041f,#03e3
	dw #03ac,#0377,#0345,#0316
	dw #02ea,#02c0,#0298,#0273
	dw #0250,#022f,#020f,#01f2
	dw #01d6,#01bb,#01a2,#018b
	dw #0175,#0160,#014c,#013a
	dw #0128,#0117,#0108,#00f9
	dw #00eb,#00de,#00d1,#00c6
	dw #00ba,#00b0,#00a6,#009d
	dw #0094,#008c,#0084,#007c
	dw #0075,#006f,#0069,#0063
	dw #005d,#0058,#0053,#004e
	dw #004a,#0046,#0042,#003e
	dw #003b,#0037,#0034,#0031
	dw #002f,#002c,#002a,#0027
	dw #0025,#0023,#0021,#001f
	dw #001d,#001c,#001a,#0019
	dw #0017,#0016,#0015,#0014
	dw #0012,#0011,#0010,#0010
	dw #000f,#000e,#0000
	db #78,#01,#7c,#01,#83,#01,#87,#01
	db #9a,#01,#a1,#01,#a5,#01,#b5,#01
	db #bc,#01,#c9,#01,#ca,#01,#d4,#01
	db #d5,#01,#d6,#01,#da,#01,#db,#01
	db #dc,#01,#dd,#01,#e4,#01,#eb,#01
	db #f2,#01,#fc,#01,#00,#02,#04,#02
	db #05,#02,#06,#02,#13,#02,#1d,#02
	db #27,#02,#31,#02,#3e,#02,#45,#02
	db #4c,#02,#4d,#02,#4e,#02,#00,#00
	db #a5,#02,#aa,#02,#b6,#02,#c0,#02
	db #cc,#02,#de,#02,#ea,#02,#f6,#02
	db #04,#03,#13,#03,#1e,#03,#2c,#03
	db #3c,#03,#48,#03,#58,#03,#63,#03
	db #64,#03,#65,#03,#77,#03,#79,#03
	db #7a,#03,#7b,#03,#7c,#03,#96,#03
	db #97,#03,#b5,#03,#b6,#03,#b7,#03
	db #b8,#03,#ce,#03,#d4,#03,#dd,#03
	db #e7,#03,#f5,#03,#ff,#03,#31,#04
	db #58,#04,#8d,#04,#d9,#04,#3d,#05
	db #52,#05,#7b,#05,#87,#05,#9b,#05
	db #a0,#05,#a1,#05,#a2,#05,#c4,#05
	db #e3,#05,#5c,#0e,#64,#0e,#69,#0e
	db #c8,#80,#c8,#ff,#01,#8d,#01,#01
	db #7f,#0d,#ff,#01,#90,#c8,#ff,#01
	db #8c,#01,#01,#82,#01,#01,#7f,#03
	db #02,#7e,#03,#07,#7f,#0b,#c8,#80
	db #c8,#ff,#01,#1d,#02,#02,#e3,#02
	db #ff,#01,#81,#01,#ff,#01,#8f,#01
	db #03,#80,#01,#01,#7f,#01,#03,#7f
	db #0e,#c8,#80,#c8,#ff,#01,#06,#01
	db #01,#f0,#01,#ff,#01,#85,#01,#01
	db #7e,#01,#01,#82,#01,#01,#7b,#01
	db #ff,#ff,#01,#84,#01,#01,#81,#0a
	db #02,#7f,#0e,#ff,#ff,#ff,#01,#96
	db #c8,#ff,#ff,#ff,#ff,#01,#8b,#01
	db #c8,#80,#c8,#ff,#01,#89,#01,#c8
	db #80,#c8,#ff,#01,#88,#01,#09,#7f
	db #08,#ff,#01,#86,#01,#03,#81,#09
	db #05,#7f,#0f,#ff,#04,#7f,#c8,#ff
	db #05,#7f,#c8,#ff,#ff,#ff,#01,#8b
	db #01,#01,#82,#01,#0c,#7f,#0d,#c8
	db #80,#c8,#ff,#02,#81,#01,#02,#7f
	db #02,#02,#81,#01,#ff,#01,#82,#05
	db #0c,#7f,#08,#c8,#80,#c8,#ff,#01
	db #8c,#01,#01,#7d,#04,#c8,#80,#c8
	db #ff,#01,#8c,#01,#01,#7e,#01,#02
	db #7f,#03,#c8,#80,#c8,#ff,#01,#8d
	db #01,#c8,#80,#c8,#ff,#01,#1d,#02
	db #02,#e3,#02,#ff,#ff,#ff,#ff,#c8
	db #ff,#ff,#ff,#ff,#ff,#01,#c8,#80
	db #c8,#ff,#ff,#ff,#ff,#ff,#ff,#ff
	db #ff
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#f4,#5a,#fe,#ff
	db #ff,#03,#e9,#03,#ea,#04,#eb,#08
	db #e6,#0b,#28,#19,#fe,#03,#e9,#01
	db #ea,#02,#eb,#05,#5f,#09,#fe,#03
	db #e9,#01,#ea,#02,#eb,#05,#e6,#06
	db #59,#09,#fe,#03,#f4,#32,#e9,#06
	db #ea,#00,#eb,#08,#e6,#05,#18,#09
	db #e6,#05,#0c,#23,#fe,#04,#e9,#06
	db #ea,#07,#eb,#08,#e6,#09,#29,#1b
	db #fe,#04,#e9,#06,#ea,#07,#eb,#08
	db #e6,#09,#35,#23,#fe,#01,#f4,#14
	db #02,#08,#03,#09,#e9,#0a,#ea,#00
	db #3c,#26,#fe,#f4,#14,#e9,#0a,#ea
	db #00,#eb,#00,#00,#04,#e6,#01,#46
	db #26,#fe,#f4,#14,#e9,#0a,#ea,#00
	db #00,#08,#50,#26,#fe,#01,#f4,#14
	db #02,#0b,#03,#0c,#e9,#0a,#ea,#00
	db #50,#20,#fe,#02,#f4,#14,#e9,#0a
	db #ea,#00,#eb,#00,#00,#04,#e6,#01
	db #46,#20,#fe,#03,#f4,#14,#e9,#0a
	db #ea,#00,#00,#08,#3c,#20,#fe,#01
	db #f4,#5a,#02,#0e,#03,#00,#e9,#1e
	db #ea,#1a,#ed,#18,#ee,#11,#ff,#f4
	db #5a,#e9,#1e,#ea,#1a,#ed,#0c,#ee
	db #11,#ff,#ff,#fe,#11,#06,#00,#01
	db #11,#08,#93,#8c,#8f,#96,#95,#91
	db #0f,#20,#ea,#0d,#8f,#fe,#fe,#fe
	db #fe,#fe,#fe,#02,#f4,#1e,#e9,#11
	db #ec,#0c,#32,#0b,#b9,#b7,#ba,#e9
	db #12,#b2,#b9,#b7,#ba,#e9,#13,#b2
	db #b9,#b7,#3a,#42,#fe,#fe,#02,#f4
	db #1e,#e9,#11,#ec,#0c,#ed,#02,#eb
	db #1a,#32,#09,#b9,#b7,#bb,#b9,#3e
	db #1b,#e9,#12,#32,#09,#b9,#b7,#bb
	db #b9,#3e,#1b,#fe,#fe,#ff,#ff,#01
	db #f4,#0a,#f4,#0f,#e9,#14,#ea,#15
	db #eb,#16,#e6,#0e,#5f,#0f,#f4,#0a
	db #e6,#0e,#5f,#46,#fe,#03,#e9,#00
	db #ea,#00,#fe,#02,#e9,#00,#ea,#00
	db #56,#63,#d6,#fe,#04,#f4,#14,#e9
	db #0a,#ea,#02,#3c,#24,#fe,#04,#f4
	db #14,#e9,#01,#ea,#11,#eb,#12,#e6
	db #07,#3e,#0e,#fe,#04,#f4,#14,#e9
	db #0a,#ea,#01,#52,#20,#fe,#01,#f4
	db #5a,#02,#23,#03,#24,#e9,#19,#eb
	db #00,#ec,#00,#ed,#00,#ee,#25,#ee
	db #25,#ee,#25,#ee,#25,#02,#27,#ed
	db #02,#ee,#25,#ed,#06,#ee,#25,#02
	db #23,#ed,#00,#ee,#25,#ee,#25,#02
	db #2a,#ed,#18,#ee,#2a,#ee,#2b,#ff
	db #f4,#5a,#e9,#19,#eb,#00,#ea,#00
	db #ec,#00,#ed,#0c,#ee,#25,#ed,#10
	db #e9,#1e,#ee,#28,#ed,#0e,#ee,#28
	db #ed,#0c,#ee,#28,#ed,#10,#ee,#29
	db #ee,#29,#ed,#1a,#ee,#2a,#ff,#f4
	db #5a,#e9,#1d,#eb,#00,#ea,#00,#ec
	db #0c,#ed,#0c,#ee,#26,#ee,#26,#ee
	db #26,#ee,#26,#ed,#0e,#ec,#13,#ee
	db #26,#ec,#00,#ed,#06,#ee,#26,#ed
	db #00,#ec,#0c,#ee,#26,#ed,#0c,#ee
	db #26,#ed,#0c,#ed,#1f,#ee,#2a,#ee
	db #2b,#ee,#2b,#ff,#f4,#5a,#ea,#1a
	db #1c,#2a,#1c,#1c,#17,#0e,#ea,#1c
	db #a5,#ea,#1a,#a3,#21,#2a,#21,#1c
	db #1e,#15,#9c,#1a,#2a,#1a,#1c,#15
	db #0e,#ea,#1c,#a3,#ea,#1a,#a1,#1f
	db #2a,#1f,#1c,#1c,#15,#9a,#18,#2a
	db #18,#1c,#13,#0e,#ea,#1c,#a1,#ea
	db #1a,#9f,#1d,#2a,#9d,#17,#1c,#1c
	db #2a,#1c,#1c,#1c,#0e,#20,#07,#9e
	db #9c,#9b,#1a,#1c,#9e,#a1,#a6,#ff
	db #f4,#5a,#34,#0e,#af,#e6,#06,#b4
	db #af,#b4,#af,#e6,#06,#b4,#af,#b4
	db #b1,#e6,#06,#b4,#b1,#b4,#b6,#e6
	db #06,#b4,#b1,#b2,#ad,#e6,#06,#b2
	db #ad,#b2,#ad,#e6,#06,#b2,#ad,#b2
	db #af,#e6,#06,#b2,#b4,#ab,#af,#e6
	db #06,#b2,#af,#b0,#ab,#e6,#06,#b0
	db #b2,#b0,#ab,#e6,#06,#b0,#ab,#a9
	db #ad,#e6,#06,#b0,#ad,#b0,#ad,#e6
	db #06,#b0,#a9,#a8,#ac,#e6,#06,#af
	db #ac,#af,#ac,#e6,#06,#af,#ac,#b2
	db #ad,#e6,#06,#b2,#ad,#b6,#ad,#e6
	db #06,#b9,#ad,#ff,#f4,#5a,#ed,#02
	db #e9,#1d,#ee,#26,#e9,#19,#ed,#05
	db #e9,#1b,#ee,#2e,#ed,#0d,#ee,#2f
	db #ff,#f4,#5a,#28,#07,#a6,#a4,#9f
	db #a2,#a8,#ab,#a9,#a8,#a6,#a4,#9f
	db #a2,#a8,#ab,#a9,#a9,#a4,#a1,#9d
	db #a1,#a4,#2d,#09,#2b,#05,#29,#07
	db #a4,#a1,#9d,#a1,#a4,#29,#09,#27
	db #05,#ff,#f4,#5a,#28,#07,#a6,#a4
	db #9f,#a4,#a8,#ab,#a9,#ff,#f4,#5a
	db #28,#07,#a4,#9f,#9c,#a4,#9f,#9c
	db #98,#9f,#9c,#98,#93,#9c,#98,#93
	db #90,#ff,#f4,#5a,#00,#38,#ff,#ff
	db #ff,#f4,#5a,#ec,#18,#2d,#19,#00
	db #0e,#2d,#1c,#2e,#0e,#30,#1c,#b2
	db #00,#0e,#b2,#33,#1c,#b5,#b7,#00
	db #0e,#37,#1c,#38,#0e,#ba,#3c,#62
	db #46,#0e,#ff,#f4,#5a,#00,#0e,#ad
	db #00,#0e,#2d,#1c,#2e,#0e,#30,#1c
	db #b2,#00,#0e,#b2,#34,#1c,#b5,#37
	db #46,#37,#0e,#b4,#b1,#32,#7e,#00
	db #70,#ff,#ff,#ff
;---------
FINISH          DEFL $
;                LIST
;                CLOSE
;START           DEFL START
;FINISH          DEFL FINISH
LENGTH          DEFL FINISH-START

.game_name
	db "Herobotix",0
.game_year
	db "1986",0
.game_publisher
	db "Wise OWL Software Ltd.",0
.music_author
	db "Dave Rogers",0
.music_comment
	db "EROBOSD.ASM HEROBOTIX sound driver J.Dave Rogers, 1988",0

	read "music_end_v1_0.asm"
